package com.suneast.suneaststore.bean.shopcart;

public class ItemGoodsInShopCart {

    private int id;        //购物车itemId
    private int goodsId;  //产品id
    private int merchId;   //商店id
    private int optionId;    // 产品规格ID
    private int total;          // 产品数量
    private double width;    // 产品宽度
    private double height;    // 产品高度
    private double volume;   //面积
    private boolean selected;//是否被选中
    private boolean suit;// 是否整卷购买 true:整卷 false :零裁
    private boolean install;  //是否上门安装
    private boolean custom;   // 是否定制
    private boolean machining;  //是否加工
    private double marketPrice;//市场价
    private double machiningPrice; // 加工单价
    private double installPrice; // 安装单价
    private String title;
    private String thumb;
    private int priceType;//价格计算类型
    private double kg; //重量
    private int dispatchId;  //运费
    private int pCate;
    private double discount;        //帘邦豆单价
    private double price;        //单价
    private double maxHeight;
    private double maxWidth;
    private int minBuy;
    private int stock;
    private double totalNum;
    private String optionTitle;
    private double suitPrice;
    private String machiningUnit;
    private String installUnit;
    private double coinDiscount;
    private double oldPrice;
    private double oldDiscount;
    private double totalMarketPrice; // 单价乘以数量的总价
    private double coinRewardPercent;// 帘邦豆单价乘以数量的总帘邦豆价

    public ItemGoodsInShopCart() {
        title = "";
        thumb = "";
        optionTitle = "";
        machiningUnit = "";
        installUnit = "";
    }

    public ItemGoodsInShopCart(ItemGoodsInShopCart item) {
        id = item.getId();
        goodsId = item.getGoodsId();  //产品id
        merchId = item.getMerchId();   //商店id
        optionId = item.getOptionId();    // 产品规格ID
        total = item.getTotal();          // 产品数量
        width = item.getWidth();    // 产品宽度
        height = item.getHeight();    // 产品高度
        volume = item.getVolume();   //面积
        selected = item.isSelected();//是否被选中
        suit = item.isSuit();// 是否整卷购买 true:整卷 false :零裁
        install = item.isInstall();  //是否上门安装
        custom = item.isCustom();   // 是否定制
        machining = item.isMachining();  //是否加工
        marketPrice = item.getMarketPrice();//市场价
        machiningPrice = item.machiningPrice; // 加工单价
        installPrice = item.getInstallPrice(); // 安装单价
        title = item.getTitle();
        thumb = item.getThumb();
        priceType = item.getPriceType();//价格计算类型
        kg = item.getKg(); //重量
        dispatchId = item.dispatchId;  //运费
        pCate = item.getpCate();
        discount = item.getDiscount();        //帘邦豆单价
        price = item.getPrice();        //单价
        maxHeight = item.getMaxHeight();
        maxWidth = item.getMaxWidth();
        minBuy = item.getMinBuy();
        stock = item.getStock();
        totalNum = item.getTotalNum();
        optionTitle = item.getOptionTitle();
        suitPrice = item.getSuitPrice();
        machiningUnit = item.getMachiningUnit();
        installUnit = item.getInstallUnit();
        coinDiscount = item.getCoinDiscount();
        oldPrice = item.getOldPrice();
        oldDiscount = item.getOldDiscount();
        totalMarketPrice = item.getTotalMarketPrice(); // 单价乘以数量的总价
        coinRewardPercent = item.getCoinRewardPercent();// 帘邦豆单价乘以数量的总帘邦豆价
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    public int getMerchId() {
        return merchId;
    }

    public void setMerchId(int merchId) {
        this.merchId = merchId;
    }

    public int getOptionId() {
        return optionId;
    }

    public void setOptionId(int optionId) {
        this.optionId = optionId;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getVolume() {
        return volume;
    }

    public void setVolume(double volume) {
        this.volume = volume;
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public boolean isSuit() {
        return suit;
    }

    public void setSuit(boolean suit) {
        this.suit = suit;
    }

    public boolean isInstall() {
        return install;
    }

    public void setInstall(boolean install) {
        this.install = install;
    }

    public boolean isCustom() {
        return custom;
    }

    public void setCustom(boolean custom) {
        this.custom = custom;
    }

    public boolean isMachining() {
        return machining;
    }

    public void setMachining(boolean machining) {
        this.machining = machining;
    }

    public double getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(double marketPrice) {
        this.marketPrice = marketPrice;
    }

    public double getMachiningPrice() {
        return machiningPrice;
    }

    public void setMachiningPrice(double machiningPrice) {
        this.machiningPrice = machiningPrice;
    }

    public double getInstallPrice() {
        return installPrice;
    }

    public void setInstallPrice(double installPrice) {
        this.installPrice = installPrice;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getThumb() {
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    public int getPriceType() {
        return priceType;
    }

    public void setPriceType(int priceType) {
        this.priceType = priceType;
    }

    public double getKg() {
        return kg;
    }

    public void setKg(double kg) {
        this.kg = kg;
    }

    public int getDispatchId() {
        return dispatchId;
    }

    public void setDispatchId(int dispatchId) {
        this.dispatchId = dispatchId;
    }

    public int getpCate() {
        return pCate;
    }

    public void setpCate(int pCate) {
        this.pCate = pCate;
    }

    public double getDiscount() {
        return discount;
    }

    public void setDiscount(double discount) {
        this.discount = discount;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getMaxHeight() {
        return maxHeight;
    }

    public void setMaxHeight(double maxHeight) {
        this.maxHeight = maxHeight;
    }

    public double getMaxWidth() {
        return maxWidth;
    }

    public void setMaxWidth(double maxWidth) {
        this.maxWidth = maxWidth;
    }

    public int getMinBuy() {
        return minBuy;
    }

    public void setMinBuy(int minBuy) {
        this.minBuy = minBuy;
    }

    public int getStock() {
        return stock;
    }

    public void setStock(double stock) {
        this.stock = (int) stock;
    }

    public double getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(double totalNum) {
        this.totalNum = totalNum;
    }

    public String getOptionTitle() {
        return optionTitle;
    }

    public void setOptionTitle(String optionTitle) {
        this.optionTitle = optionTitle;
    }

    public double getSuitPrice() {
        return suitPrice;
    }

    public void setSuitPrice(double suitPrice) {
        this.suitPrice = suitPrice;
    }

    public String getMachiningUnit() {
        return machiningUnit;
    }

    public void setMachiningUnit(String machiningUnit) {
        this.machiningUnit = machiningUnit;
    }

    public String getInstallUnit() {
        return installUnit;
    }

    public void setInstallUnit(String installUnit) {
        this.installUnit = installUnit;
    }

    public double getCoinDiscount() {
        return coinDiscount;
    }

    public void setCoinDiscount(double coinDiscount) {
        this.coinDiscount = coinDiscount;
    }

    public double getOldPrice() {
        return oldPrice;
    }

    public void setOldPrice(double oldPrice) {
        this.oldPrice = oldPrice;
    }

    public double getOldDiscount() {
        return oldDiscount;
    }

    public void setOldDiscount(double oldDiscount) {
        this.oldDiscount = oldDiscount;
    }

    public double getTotalMarketPrice() {
        return totalMarketPrice;
    }

    public void setTotalMarketPrice(double totalMarketPrice) {
        this.totalMarketPrice = totalMarketPrice;
    }

    public double getCoinRewardPercent() {
        return coinRewardPercent;
    }

    public void setCoinRewardPercent(double coinRewardPercent) {
        this.coinRewardPercent = coinRewardPercent;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof ItemGoodsInShopCart) {
            ItemGoodsInShopCart itemGoods = (ItemGoodsInShopCart) obj;
            return itemGoods.getOptionId() == this.getOptionId() &&
                    itemGoods.getTotal() == this.getTotal() &&
                    itemGoods.getHeight() == this.getHeight() &&
                    itemGoods.getWidth() == this.getWidth() &&
                    itemGoods.isSuit() == this.isSuit() &&
                    itemGoods.isInstall() == this.isInstall() &&
                    itemGoods.isCustom() == this.isCustom() &&
                    itemGoods.isMachining() == this.isMachining();
        }
        return false;
    }
}
